
</div>
<script src="__PUBLICS__/layui/layui.js"></script>
<script>
    var message;
    layui.config({
        base: '__JS__/',
        version: '1.0.1'
    }).use(['app', 'message'], function() {
        var app = layui.app,
            $ = layui.jquery,
            layer = layui.layer;
        //将message设置为全局以便子页面调用
        message = layui.message;
        //主入口
        app.set({
            type: 'iframe'
        }).init();

        $('dl.skin > dd').on('click', function() {
            var $that = $(this);
            var skin = $that.children('a').data('skin');
            switchSkin(skin);
        });
        var setSkin = function(value) {
                layui.data('kit_skin', {
                    key: 'skin',
                    value: value
                });
            },
            getSkinName = function() {
                return layui.data('kit_skin').skin;
            },
            switchSkin = function(value) {
                var _target = $('link[kit-skin]')[0];
                _target.href = _target.href.substring(0, _target.href.lastIndexOf('/') + 1) + value + _target.href.substring(_target.href.lastIndexOf('.'));
                setSkin(value);
            },
            initSkin = function() {
                var skin = getSkinName();
                switchSkin(skin === undefined ? 'default' : skin);
            }();

        $('#color').click(function(){
            layer.open({
                type:1,
                title:'配色方案',
                area: ['290px', 'calc(100% - 52px)'],
                offset: 'rb',
                shadeClose:true,
                id:'colors',
                anim: 2,
                shade:0.2,
                closeBtn:0,
                isOutAnim:false,
                resize:false,
                move: false,
                skin: 'color-class',
                btn:['黑白格','橘子橙','原谅绿','少女粉','天空蓝','枫叶红'],
                yes: function(index, layero){
                    switchSkin('default');
                }
                ,btn2: function(index, layero){
                    switchSkin('orange');
                    return false;
                }
                ,btn3: function(index, layero){
                    switchSkin('green');
                    return false;
                }
                ,btn4: function(index, layero){
                    switchSkin('pink');
                    return false;
                }
                ,btn5: function(index, layero){
                    switchSkin('blue.1');
                    return false;
                }
                ,btn6: function(index, layero){
                    switchSkin('red');
                    return false;
                }

            });
        })
    });
</script>
<script src="__PUBLICS__/jquery/jquery.min.js"></script>
<script type="text/javascript">

    layui.use('jquery', function() {
        var $ = layui.jquery;
        $('#clear').on('click', function() {
            var the = $(this).find('i');
            the.attr("class","fa fa-spinner");
            $.ajax({
                url:"{:U('System/cleanCache')}/quick/1" ,
                dataType: "json",
               success:function(res) {
                    if(res.code == 1) {
                        setTimeout(function(){
                            layer.msg(res.msg,{offset: '250px',anim: 4});
                            $('#clear i').attr("class","fa fa-institution");
                        },1000)
                    }
                }
            })
        });
    });

    $('#logout').click(function(){
        layer.confirm('真的要退出?',{icon: 3, title:'提示',anim: 2}, function(index){
            $.ajax({
                url:"{:U('admin/logout')}",
                dataType: "json",
                success:function(res) {

                    layer.msg(res.msg);
                    if(res.code == 1) {
                        setTimeout(function(){
                            location.href = res.url;
                        },2000)
                    }
                }
            })
        })
    })

    $('.layui-nav-item').click(function(){
        $(this).siblings('li').attr('class','layui-nav-item');
    })
</script>

<script type="text/javascript">
    layui.use('layer', function(){
        var layer = layui.layer;
        var remember = '';

        $('#tag').click(function(){
            var tag = localStorage.getItem("tag");
            layer.prompt({
                formType: 2,
                anim: 1,
                offset: ['52px', 'calc(100% - 500px)'],
                value: tag,
                title: '便签',
                skin: 'demo-class',
                area: ['280px', '150px'],
                id: 'remember' ,//设定一个id，防止重复弹出
                btn: ['写好了', '忘了吧'],
                shade: 0,
                moveType: 1, //拖拽模式，0或者1
                btn2: function(index, layero){
                    localStorage.removeItem("tag");
                    $('#remember textarea').val('');
                    return false;
                }
            },function(value, index, elem){
                localStorage.setItem("tag",value);
            })
        });
    });
</script>
</body>
</html>